
package com.woniuxy.educationplatform.service.impl;

import com.woniuxy.educationplatform.bean.TestBean;
import com.woniuxy.educationplatform.mapper.QuesMapper;
import com.woniuxy.educationplatform.mapper.TestMapper;
import com.woniuxy.educationplatform.service.ITestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Transactional(readOnly = true)
@Service
public class TestServiceImpl implements ITestService {
    @Resource
    private TestMapper testMapper;

    @Override
    public List<TestBean> findAll(TestBean testBean) {
        return testMapper.findAll(testBean);
    }

    @Override
    public TestBean getOneById(Long id) {
        return testMapper.getOneById(id);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public int addTestBean(TestBean testBean) {
        return testMapper.addTestBean(testBean);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public int updateTestBean(TestBean testBean) {
        return testMapper.updateTestBean(testBean);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public int deleteTestBean(Long id) {
        return testMapper.deleteTestBean(id);
    }
}

